#include <stdio.h>
int main (void)                      
{   
    int turtle,rabbit,time,t,count;
    turtle=rabbit=0;
    count=0;
    scanf("%d",&time);
    t=0;
    while(t<time)
    {   
    	t++;
    	count++;
    	turtle=turtle+3;
    	rabbit=rabbit+9;
    	if(count==10)
    	{
    		if(rabbit>turtle)
    		{
    		    if(t+30>=time) 
				 {
				   turtle=turtle+3*(time-t);
				   t=time;
				 } 
    			else 
				{
					turtle=turtle+3*30;
					t=t+30;
				}
			}
    		count=0;
		}
	}
	if(rabbit>turtle) printf("^_^ %d",rabbit);
	else if(rabbit<turtle) printf("@_@ %d",turtle);
	else printf("-_- %d",rabbit);
    return 0;
}
